@echo off&Color F0
: Définition des constantes
set APPURL=http://fileforum.betanews.com/sendfile/1043809773/1/spybotsd152.exe
set APPSETUP=spybotsd152.exe
set APP=SpybotSD
set APPDIR=App\SpybotSD
set APPEXE=SpybotSD.exe
set LOCALDIR1=Spybot - Search
set LOCALDIR2=Destroy
set REGKEY1=HKEY_CURRENT_USER\Software\Safer Networking Limited\SpybotSnD
set LOCALDIR3=%ALLUSERSPROFILE%\Application Data\Spybot - Search
: Recherche d'une version installée
if exist "%ProgramFiles%\%LOCALDIR1% & %LOCALDIR2%\%APPEXE%" goto _installed
: Téléchargement du setup
if exist "%APPSETUP%" goto _extract
echo T‚l‚chargement de %APPSETUP%
..\_Build\Wget\wget %APPURL% -O %APPSETUP%
: Extraction des fichiers du setup
if exist %APPSETUP% goto _extract
goto _error
:_extract
: Extract-Copy-Inno
cls
echo Extraction des fichiers de %APPSETUP%
..\_Build\InnoUnp\innounp -x -dTemp %APPSETUP%
cls
echo Copie des fichiers dans %APPDIR%
xcopy "Temp\{app}\*.*" "%APPDIR%\" /q /y
xcopy "Temp\{app}\Dummies\*.*" "%APPDIR%\Dummies\" /s /q /y
xcopy "Temp\{app}\Help\English.chm" "%APPDIR%\Help\" /q /y
xcopy "Temp\{app}\Help\Francais.license.txt" "%APPDIR%\Help\" /q /y
xcopy "Temp\{app}\Includes\*.*" "%APPDIR%\Includes\" /s /q /y
xcopy "Temp\{app}\Languages\English.sbl" "%APPDIR%\Languages\" /q /y
xcopy "Temp\{app}\Languages\Francais.sbl" "%APPDIR%\Languages\" /q /y
xcopy "Temp\{app}\Plugins\*.*" "%APPDIR%\Plugins\" /s /q /y
xcopy "Temp\{app}\Skins\*.*" "%APPDIR%\Skins\" /s /q /y
xcopy "Temp\{app}\Updates\*.*" "%APPDIR%\Updates\" /s /q /y
xcopy "Temp\{userappdata}\Spybot - Search & Destroy\*.*" "Data\%APP%\" /s /q /y
cls
echo Effacement des fichiers temporaires
rmdir Temp /s /q
cls
echo Effacer le setup ?
del %APPSETUP% /p 
goto _pack
: Copie des fichiers installés
:_installed
echo Copie des fichiers de "%ProgramFiles%\%LOCALDIR1% & %LOCALDIR2%"
xcopy "%ProgramFiles%\%LOCALDIR1% & %LOCALDIR2%\*.*" "%APPDIR%\" /s /q
del "%APPDIR%\unins000.exe"
del "%APPDIR%\unins000.dat"
cls
echo Exportation du registre
mkdir Data
regedit /e Data\%APP%.reg "%REGKEY1%"
cls
echo Copie de "%LOCALDIR3% & %LOCALDIR2%"
xcopy "%LOCALDIR3% & %LOCALDIR2%\*.*" "Data\%APP%\" /s /q
: Compression des exe et dll
:_pack
: Pack
goto _end
:_error
cls
echo %APPSETUP% doit se trouver dans ce dossier !
pause
:_end
